﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CanDoo.Core.Data;
using CanDoo.Data;
using CanDoo.Admin.Core.Models;

namespace CanDoo.Oil.Core.Models
{
    /// <summary>
    /// 实体类——取油日志
    /// </summary>
    [Serializable]
    [Description("取油日志")]
    public class GetOil :  EntityBase,ICreatedTime, IAudited
    {
        /// <summary>
        ///售油机
        /// </summary>
        [Display(Name = "售油机")]
        public virtual OilSalesSerialNum OilSalesSerialNum { get; set; }
        /// <summary>
        ///售油机外键
        /// </summary>
        [Display(Name = "售油机外键")]
        public long OilSalesSerialNumId { get; set; }

        /// <summary>
        ///通道号
        /// </summary>
        [Display(Name = "通道号")]
        public int OilPort { get; set; }

        /// <summary>
        ///油桶序列号
        /// </summary>
        [Display(Name = "油桶序列号")]
        public virtual OilSerialNum OilSerialNum { get; set; }
        /// <summary>
        ///油桶序列号外键
        /// </summary>
        [Display(Name = "油桶序列号外键")]
        public long? OilSerialNumId { get; set; }

        /// <summary>
        ///操作类型0余额取油 1银联支付取油 2取油码取油 3调试出油
        /// </summary>
        [Display(Name = "操作类型0余额取油 1银联支付取油 2取油码取油 3调试出油")]
        [Required]
        public int OperateType { get; set; }

        /// <summary>
        ///操作时间
        /// </summary>
        [Display(Name = "操作时间")]
        [Required]
        public DateTime? OpreateTime { get; set; }

        /// <summary>
        ///出油量
        /// </summary>
        [Display(Name = "出油量")]
        [Required]
        public double OilOutPut { get; set; }

        /// <summary>
        ///操作前油量
        /// </summary>
        [Display(Name = "操作前油量")]
        [Required]
        public double OilBefore { get; set; }

        /// <summary>
        ///剩余油量
        /// </summary>
        [Display(Name = "剩余油量")]
        [Required]
        public double OilAfter { get; set; }

        /// <summary>
        ///单价
        /// </summary>
        [Display(Name = "单价")]
        [Required]
        public double Price { get; set; }

        /// <summary>
        ///金额
        /// </summary>
        [Display(Name = "金额")]
        [Required]
        public double Money { get; set; }

        /// <summary>
        ///关联数据ID
        /// </summary>
        [Display(Name = "关联数据ID")]
        public Guid LinkEntityId { get; set; }

        /// <summary>
        ///操作前金额
        /// </summary>
        [Display(Name = "操作前金额")]
        [Required]
        public double MoneyBefore { get; set; }

        /// <summary>
        ///操作后金额
        /// </summary>
        [Display(Name = "操作后金额")]
        [Required]
        public double MoneyAfter { get; set; }

        /// <summary>
        ///关联金额变动
        /// </summary>
        [Display(Name = "关联金额变动")]
        public virtual MoneyChange MoneyChange { get; set; }
        /// <summary>
        ///关联金额变动外键
        /// </summary>
        [Display(Name = "关联金额变动外键")]
        public long? MoneyChangeId { get; set; }

        /// <summary>
        ///取油客户
        /// </summary>
        [Display(Name = "取油客户")]
        public virtual User Customer { get; set; }
        /// <summary>
        ///取油客户外键
        /// </summary>
        [Display(Name = "取油客户外键")]
        public long? CustomerId { get; set; }

        
        #region Implementation of ICreatedTime

        /// <summary>
        /// 获取设置 信息创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        public DateTime CreatedTime { get; set; }
        #endregion

        #region Implementation of ICreatedAudited

        /// <summary>
        /// 获取或设置 创建者编号
        /// </summary>
        [Display(Name = "创建人")]
        public string CreatorUserId { get; set; }

        #endregion

        #region Implementation of IUpdateAutited

        /// <summary>
        /// 获取或设置 最后更新时间
        /// </summary>
        [Display(Name = "最后更新时间")]
        public DateTime? LastUpdatedTime { get; set; }

        /// <summary>
        /// 获取或设置 最后更新者编号
        /// </summary>
        [Display(Name = "最后更新用户")]
        public string LastUpdatorUserId { get; set; }

        #endregion
    }
}
